package com.real.fact.web.sale.view;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.ServletRequestDataBinder;

import com.globant.katari.core.spring.controller.CommandController;

public abstract class ListSalesController extends CommandController {

  
  public ListSalesController(String theViewName) {
    super(theViewName);
  }

  /**
   * Default date format.
   */
  private static final SimpleDateFormat FORMAT = new SimpleDateFormat(
      "dd-MM-yyyy");

  /**
   * {@inheritDoc}
   */
  @Override
  protected void initBinder(final HttpServletRequest request,
      final ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(Date.class,
        new CustomDateEditor(FORMAT, true));
    super.initBinder(request, binder);
  }

}
